//
//  ViewController.m
//  diskCachedTest
//
//  Created by Vincent on 2017/2/25.
//  Copyright © 2017年 Vincent. All rights reserved.
//

#import "ViewController.h"
#import "ZLLDiskCache.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    
    
    
    [ZLLDiskCache cacheObject:self forKey:@"test" atPath:NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).lastObject completionBlock:^(NSString *key, id<NSCoding> object, NSURL *fileURL, NSError *error) {
        
        NSLog(@"error:%@",error);
    }];
    
    [ZLLDiskCache objectForKey:@"test" atPath:NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).lastObject completionBlock:^(NSString *key, id<NSCoding> object, NSURL *fileURL, NSError *error) {
        
        NSLog(@"error:%@",error);
    }];
    
    [ZLLDiskCache removeObjectForKey:@"test" atPath:NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).lastObject completionBlock:^(NSString *key, id<NSCoding> object, NSURL *fileURL, NSError *error) {
        
        NSLog(@"error:%@",error);
    }];
    
    NSLog(@"finished");
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
